//
//  SYRegisterView.m
//  BSHOUYIFANG
//
//  Created by lanou3g on 15/8/19.
//  Copyright (c) 2015年 CYB. All rights reserved.
//

#import "SYRegisterView.h"
#import "Header.h"
@implementation SYRegisterView

-(instancetype)initWithFrame:(CGRect)frame
{
    self =[super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self p_setupSubviews];
    }
    return self;
}

- (void)p_setupSubviews
{
    _phoneNumberTF = [[UITextField alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/12,SCREEN_WIDTH/4, SCREEN_WIDTH/1.2, SCREEN_WIDTH/10)];
    _phoneNumberTF.placeholder =@"手机号";
    _phoneNumberTF.tag = 1000;
    _phoneNumberTF.borderStyle = UITextBorderStyleRoundedRect;
    
    _nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _nextButton.frame = CGRectMake(SCREEN_WIDTH/12,SCREEN_HEIGHT/4+5,SCREEN_WIDTH/1.2,SCREEN_WIDTH/10);
    _nextButton.backgroundColor = [UIColor redColor];
    [_nextButton setTitle:@"下一步" forState:UIControlStateNormal];
    _nextButton.titleLabel.textColor =[UIColor whiteColor];
    
    UILabel *protocolLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0,SCREEN_WIDTH/2.8,20)];
    protocolLabel.text =@"注册账号表示同意";
    protocolLabel.font = [UIFont systemFontOfSize:14];
    
    _protocolButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _protocolButton.frame = CGRectMake(SCREEN_WIDTH/3.1, 0,SCREEN_WIDTH/3.2,20);
    [_protocolButton setTitle:@"最终用户协议" forState:UIControlStateNormal];
    _protocolButton.titleLabel.font =[UIFont systemFontOfSize:14];
    [_protocolButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    
    UIView *LBView = [[UIView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/5, SCREEN_HEIGHT/2.4, SCREEN_WIDTH/1.5, 20)];
    [LBView addSubview:protocolLabel];
    [LBView addSubview:_protocolButton];
    
    
    _yetButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _yetButton.frame = CGRectMake(SCREEN_WIDTH/2 - SCREEN_WIDTH/6, SCREEN_HEIGHT/2.4-SCREEN_WIDTH/5.3 +30, SCREEN_WIDTH/3, 20);
    [_yetButton setTitle:@"已有账号登录" forState:UIControlStateNormal];
    _yetButton.titleLabel.font = [UIFont systemFontOfSize:14];
    [_yetButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    
    [self addSubview:LBView];
    [self addSubview:_nextButton];
    [self addSubview:_phoneNumberTF];
//    [self addSubview:_protocolButton];
//    [self addSubview:protocolLabel];
    [self addSubview:_yetButton];
}

//获取输入框的内容
- (NSString *)phoneNumberText
{
    return _phoneNumberTF.text;
}

@end
